//
//  TKSellerInformationHeaderView.m
//  Ticket
//
//  Created by 小禹宝宝 on 2017/10/28.
//  Copyright © 2017年 cy55. All rights reserved.
//

#import "TKSellerInformationHeaderView.h"
@interface TKSellerInformationHeaderView ()
@property (nonatomic, strong) UIView *lineView;
@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
@property (weak, nonatomic) IBOutlet UILabel *sellNameLabel;

@end
@implementation TKSellerInformationHeaderView

-(void)awakeFromNib {
    [super awakeFromNib];
    [self addLineView];
    self.iconImageView.layer.borderWidth = 2.0f;
    self.iconImageView.layer.borderColor = [[UIColor jc_colorWithHexString:@"eeeeee"] CGColor];
    self.iconImageView.layer.cornerRadius = self.iconImageView.bounds.size.width/2;
    self.iconImageView.layer.masksToBounds = YES;
    self.iconImageView.contentMode = UIViewContentModeScaleAspectFill;

}

- (void)addLineView
{
    _lineView = [[UIView alloc] init];
    _lineView.backgroundColor = [BLColorConfig lineColor];
    [self addSubview:_lineView];
    CGFloat height = 1.f/[UIScreen mainScreen].scale;
    [_lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(height);
        make.leading.mas_equalTo(0);
        make.trailing.mas_equalTo(0);
        make.bottom.mas_equalTo(-height);
    }];
}

-(void)setModel:(TKUserInfoModel *)model {
    _model = model;
    [self.iconImageView sd_setImageWithURL:[NSURL URLWithString:model.user_portrait] placeholderImage:[UIImage imageNamed:@"icon_placeholder"]];
    self.sellNameLabel.text = model.user_name;
}
@end
